<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
        <style type="text/css">
            #logsdiv {margin:0;padding:0;}
            #logsdiv ol {list-style-type:decimal;}
            #logsdiv ol li{display: list-item;list-style-position: inside;}
            #logsdiv ol li b{color:#06f;font-weight: normal;cursor:pointer;}
            #logsdiv ol li b:hover{color:#FB5A46;font-weight: normal;cursor:pointer;}
            #logshead{position:relative;height:100%;}
            #logsform{position:absolute;left:0;top:3px;}
            #logsrequest {position:absolute;right:0;top:0;height:540px;width:660px;background:#F7F0A0;display:none;width:1px;height:1px;}
            #requestbody {margin:5px;}
            #requestbody textarea {width:640px;}
        </style>
    </head>
    <body>
        <div style="position:fixed;width:100%;">
            <?php include(VIEWPATH . 'common/main_header.php'); ?>
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid" style="background:#fff;margin-top:0;">
                <tr>
                    <th><?= $title ?></th>
                </tr>
                <tr><td style="text-align:left;">
                        <div id="logshead">
                            <form name="logsform" id="logsform">
                                <input type="button" value="<?= translate('TODAY') ?>" type="" class="chgbtn" sid="<?= date("Y-m-d") ?>" />
                                <input type="button" value="<?= translate('YESTERDAY') ?>" class="chgbtn" sid="<?= date("Y-m-d", get_unixtime('day', -1)) ?>"/>
                                <input type="button" value="<?= translate('BEFYESTERDAY') ?>" class="chgbtn" sid="<?= date("Y-m-d", get_unixtime('day', -2)) ?>"/>
                                <?= translate('DATE') ?> <input type="text" name="seldate" style="width:90px;" class="datepicker" value="<?= date("Y-m-d") ?>" />
                                <select name="orderby" id="orderby">
                                    <option value="asc" selected><?= translate('GENERAL_LOGS_TIME_ASC') ?></option>
                                    <option value="desc"><?= translate('GENERAL_LOGS_TIME_DESC') ?></option>
                                </select>
                                <select name="location" id="location">
                                    <option value="front" selected><?= translate('GENERAL_LOGS_HEAD') ?></option>
                                    <option value="end"><?= translate('GENERAL_LOGS_TAIL') ?></option>
                                </select>
                                <select name="showlines" id="showlines">
                                    <option value="100">100</option>
                                    <option value="500">500</option>
                                    <option value="1000" selected>1000</option>
                                    <option value="5000">5000</option>
                                    <option value="10000">10000</option>
                                </select>
                                <?php foreach ($dirname as $m => $n) { ?>
                                    <input type="checkbox" name="listdir[]" value="<?= $m ?>" id="c_<?= $m ?>" <?= checkchecked('application', $m) ?> /> <label for="c_<?= $m ?>"><?= $n ?></label>
                                <?php } ?>
                                <input type="button" name="refreshlog" value="<?= translate('REFRESH') ?>" />
                                <input type="button" name="clearlog" value="<?= translate('CLEAR') ?>" style="width:70px;" />
                            </form>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="logsdiv" style="padding-top:55px;"></div>
        <script type="text/javascript">
            var st;
            $(function() {
                $("input[name=clearlog]").click(function() {
                    $.ajax({
                        url: '<?= site_url("general/logs/clearlog") ?>',
                        type: 'POST',
                        data: $("#logsform").serialize(),
                        cache: false,
                        success: function(data) {
                            $("#logsdiv").html(data);
                        }
                    });
                });
                $(".chgbtn").click(function() {
                    $("input[name=seldate]").val($(this).attr("sid")).change();
                });
                $("input[name=seldate],input[name='listdir[]'],#showlines,#orderby,#location").change(function() {
                    $.ajax({
                        url: '<?= site_url("general/logs/getlog") ?>',
                        type: 'POST',
                        data: $("#logsform").serialize(),
                        cache: false,
                        success: function(data) {
                            $("#logsdiv").html(data);
                        }
                    });
                });
                $("input[name=seldate]").change();
                $("input[name=refreshlog]").click(function() {
                    $("input[name=seldate]").change();
                });
            });
        </script>
    </body>
</html>